{template "content","header"}
     <!--<header class="lc-xsl-hd clearfix">
       <a href="javascript:;" class="lc-hd-back" onclick="JavaScript:history.back(-1);"></a>
        新丝路超模培训
    </header>-->
    <div class="teacher-list">
        <ul class="ul-teacher" id="teacher-list">
            {loop $mentorList $v}
            <li class="li-teacher">
                <div class="teacher-profile"><a href="?m=mentor&c=index&a=show&id={$v[id]}"><img src="{$v[logo]}" alt="" class="teacher-pic"></a></div>
                <div class="teacher-brief">
                    <a href="?m=mentor&c=index&a=show&id={$v[id]}"><h3 class="teacher-name">{$v[name]}</h3></a>
                    <p class="teacher-brief-txt">导师简介：{$v[description]}</p>
                </div>
            </li>
            {/loop}
        </ul>
    </div>
    {template "content","newfooter"}
    <script type="text/javascript" src="{JS_PATH}nsr/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="{JS_PATH}nsr/lc_adp.js"></script>
    <script type="text/javascript">
        $(function(){
            var tag = 1;
            var nums = $('#teacher-list li').size();
            if (nums != 5) {
                tag = 0;
            }
            var page = 1;
            $(window).scroll(function(){  
                // 被卷去的高度  
                var scrollTop = document.body.scrollTop||document.documentElement.scrollTop;  
                // 页面高度  
                var pageHeight = $(document).height();  
                // 可视区域高度  
                var viewHeight = $(window).height();  
                //alert(viewHeight);  
                //当滚动到底部时  
                if((scrollTop+viewHeight)>(pageHeight-20) && tag == 1){
                    tag = 0;
                    page++;
                    $.ajax({
                        type: "POST",
                        url: "?m=mentor&c=index&a=mentorInfo",
                        cache: false,
                        dataType:"json",
                        data: {page:page},
                        success: function(result){
                            if (result) {
                                if (result.length == 5) {
                                    tag = 1;
                                } else {
                                    tag = 0;
                                }
                                var _html = '';
                                $.each( result, function(i, n){
                                    _html += '<li class="li-teacher"><div class="teacher-profile"><a href="?m=mentor&c=index&a=show&id='+n.id+'"><img src="';
                                    _html += n.logo;
                                    _html += '" alt="" class="teacher-pic"></a></div><div class="teacher-brief"><a href="?m=mentor&c=index&a=show&id='+n.id+'"><h3 class="teacher-name">';
                                    _html += n.name;
                                    _html += '</h3><a/><p class="teacher-brief-txt">导师简介：';
                                    _html += n.description;
                                    _html += '</p></div></li>';
                                });
                                $('#teacher-list').append(_html);
                            } else {
                                tag = 0;
                            }
                        },
                        error: function(){
                          alert('请求服务器失败');
                        }
                    }); 
                    //防止无限制的增长
                    if(scrollTop<1000){  
                        return false;     
                    }  
                }  
            });
        })
    </script>
</body>
</html>